package org.eweb4j.mvc.config.bean;

import java.util.ArrayList;
import java.util.List;

import org.eweb4j.mvc.action.RequestMethodType;
import org.eweb4j.util.xml.tag.XmlTag;
import org.eweb4j.util.xml.tag.XmlTagType;

/**
 * MVC组件用来存取配置信息的Bean
 * 
 * @author cfuture.aw
 * @since v1.a.0
 */
public class ActionConfigBean {
	@XmlTag(type = XmlTagType.attriType, value = "1")
	private String level;
	@XmlTag(type = XmlTagType.listElementType, value = "*/*")
	private List<String> produces = new ArrayList<String>();
	@XmlTag(type = XmlTagType.listElementType, value = "*/*")
	private List<String> consumes = new ArrayList<String>();
	@XmlTag(type = XmlTagType.attriType)
	private String reqMethod = RequestMethodType.GET;

	@XmlTag(type = XmlTagType.attriType)
	private String name;
	@XmlTag(type = XmlTagType.attriType)
	private String method;
	@XmlTag(type = XmlTagType.attriType)
	private String clazz;
	@XmlTag(type = XmlTagType.attriType)
	private String showValErrorType;
	@XmlTag(type = XmlTagType.listClassType)
	private List<ParamConfigBean> param;
	@XmlTag(type = XmlTagType.listClassType)
	private List<ResultConfigBean> result = new ArrayList<ResultConfigBean>();
	@XmlTag(type = XmlTagType.listClassType)
	private List<ValidatorConfigBean> validator;

	// @XmlTag(type = XmlTagType.attriType, value =
	// "org.eweb4j.mvc.config.bean.ActionConfigBean")
	// private String xmlBean;

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public List<String> getProduces() {
		return produces;
	}

	public void setProduces(List<String> produces) {
		this.produces = produces;
	}

	public List<String> getConsumes() {
		return consumes;
	}

	public void setConsumes(List<String> consumes) {
		this.consumes = consumes;
	}

	public String getReqMethod() {
		return reqMethod;
	}

	public void setReqMethod(String reqMethod) {
		this.reqMethod = reqMethod;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<ParamConfigBean> getParam() {
		return param;
	}

	public void setParam(List<ParamConfigBean> param) {
		this.param = param;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getClazz() {
		return clazz;
	}

	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	public String getShowValErrorType() {
		return showValErrorType;
	}

	public void setShowValErrorType(String showValErrorType) {
		this.showValErrorType = showValErrorType;
	}

	public List<ValidatorConfigBean> getValidator() {
		return validator;
	}

	public void setValidator(List<ValidatorConfigBean> validator) {
		this.validator = validator;
	}

	public List<ResultConfigBean> getResult() {
		return result;
	}

	public void setResult(List<ResultConfigBean> result) {
		this.result = result;
	}

	@Override
	public String toString() {
		return "ActionConfigBean [level=" + level + ", produces=" + produces
				+ ", consumes=" + consumes + ", reqMethod=" + reqMethod
				+ ", name=" + name + ", method=" + method + ", clazz=" + clazz
				+ ", showValErrorType=" + showValErrorType + ", param=" + param
				+ ", result=" + result + ", validator=" + validator + "]";
	}

	// public String getXmlBean() {
	// return xmlBean;
	// }
	//
	// public void setXmlBean(String xmlBean) {
	// this.xmlBean = xmlBean;
	// }

}
